export interface Schema {
  TABLE_CATALOG: string;
  TABLE_SCHEMA: string;
  TABLE_NAME: string;
  TABLE_NAME_HUMP: string;
  TABLE_NAME_INITIALS_HUMP: string;
  TABLE_TYPE: string;
  ENGINE: string;
  VERSION: string;
  ROW_FORMAT: string;
  TABLE_ROWS: string;
  AVG_ROW_LENGTH: string;
  DATA_LENGTH: string;
  MAX_DATA_LENGTH: string;
  INDEX_LENGTH: string;
  DATA_FREE: string;
  AUTO_INCREMENT: string;
  CREATE_TIME: string;
  UPDATE_TIME: string;
  CHECK_TIME: string;
  TABLE_COLLATION: string;
  CHECKSUM: string;
  CREATE_OPTIONS: string;
  TABLE_COMMENT: string;

  toString(): string;
}

export interface Table {
  TABLE_CATALOG: string;
  TABLE_SCHEMA: string;
  TABLE_NAME: string;
  COLUMN_NAME_HUMP: string;
  COLUMN_NAME_INITIALS_HUMP: string;
  COLUMN_NAME: string;
  ORDINAL_POSITION: string;
  COLUMN_DEFAULT: string;
  IS_NULLABLE: string;
  DATA_TYPE: string;
  CHARACTER_MAXIMUM_LENGTH: string;
  CHARACTER_OCTET_LENGTH: string;
  NUMERIC_PRECISION: string;
  NUMERIC_SCALE: string;
  DATETIME_PRECISION: string;
  CHARACTER_SET_NAME: string;
  COLLATION_NAME: string;
  COLUMN_TYPE: string;
  COLUMN_KEY: string;
  EXTRA: string;
  PRIVILEGES: string;
  COLUMN_COMMENT: string;
  GENERATION_EXPRESSION: string;
  SRS_ID: string;

  toString(): string;
}

export interface SchemaTables extends Schema {
  tables: Table[];
  generated: boolean;

  toString(): string;
}

export type SchemaTableList = SchemaTables[];

export interface Database {
  // 数据库uuid
  uuid?: string;
  // 数据库地址
  host: string;
  // 连接别名
  name?: string;
  // 用户名
  username: string;
  // 密码
  password: string;
  // 数据库名称
  database: string;
  // 数据库类型
  type?: string;
  // 端口
  port?: number;
  save?: string;
}

export interface DatabaseConfig extends Database {
  activeIndex: number;
  databases: Database[];
}
